<template>
  <div class="my-dialog">
    <el-dialog
      :title="title"
      :visible.sync="myShow"
      :width="width + 'px'"
      @closed="closed"
    >
      <div class="my-dialog-form"><slot></slot></div>

      <!-- <span slot="footer">
        <div style="margin-right: 15px; display: inline-block">
          <el-button type="text">清空</el-button>
        </div>
        <div
          style="margin-right: 15px; display: inline-block"
          @click="myShow = false"
        >
          <my-button>取 消</my-button>
        </div>
        <div style="display: inline-block" @click="Ok">
          <my-button :color="true">确 定</my-button>
        </div>
      </span> -->
    </el-dialog>
  </div>
</template>

<script>
// import MyButton from "@/components/MyInput/MyButton";
export default {
  props: ["show", "title", "width", "success"],
  components: {
    // MyButton,
  },
  created () {
    this.myShow = this.show
  },
  data() {
    return {
      myShow: false
    };
  },
  methods: {
    Ok() {
      this.$message({
        message: this.success,
        type: "success",
      });
      setTimeout(() => {
        this.myShow = false;
        this.closed()
      }, 500);
    },
    closed() {
      this.$emit('close',false)
    }
  },
};
</script>

<style>
.my-dialog-form{
  /* margin:10px 0 25px; */
  overflow:auto;
}
</style>